
import 'package:flutter/services.dart';
import 'package:flutter_ncsjqz_getx/util/toast_util.dart';

/// todo：剪切板操作
class CopyPaste{

  /// 复制内容
  static copy(String? text){
    Clipboard.setData(ClipboardData(text: text ?? ''));
    toast("复制成功");
  }

  /// 获取内容
  static Future<String> paste() async{
    var clipboardData = await Clipboard.getData(Clipboard.kTextPlain);
    return clipboardData?.text ?? '';
  }
}
